<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html lang="en">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<meta name="generator" content="PHPDoctor 2RC4 (http://peej.github.com/phpdoctor/)">
<meta name="when" content="Mon, 02 May 2011 02:46:56 +0000">

<link rel="stylesheet" type="text/css" href="../stylesheet.css">
<link rel="start" href="../overview-summary.html">

<title>config.php (Cornice)</title>

</head>
<body id="file" onload="parent.document.title=document.title;">

<div class="header">
<h1>Cornice</h1>
<ul>
<li><a href="../overview-summary.html">Overview</a></li>
<li>Package</li><li>Class</li><li>Tree</li><li><a href="../overview-files.html">Files</a></li>
<li><a href="../deprecated-list.html">Deprecated</a></li>
<li><a href="../todo-list.html">Todo</a></li>
<li><a href="../index-all.html">Index</a></li>
</ul>
</div>

<div class="small_links">
<a href="../index.html" target="_top">Frames</a>
<a href="../source\config.php.html" target="_top">No frames</a>
</div>
<hr>

<h1>config.php</h1>
<div class="comment" id="overview_description"><p>============================================================================ * Cornice PHP Framework & Website Builder * Freeware (f) 2011 by Inforo Software & Computer *============================================================================</p></div>

<hr>

<a name="line1"></a><pre><?php/** *============================================================================ * Cornice PHP Framework & Website Builder * Freeware (f) 2011 by Inforo Software & Computer *============================================================================ */ /** * Class for accessing config.xml * @author Nicola Dinh * @version 2011.04.2217 */class config {  /*   * All properties   */  private static $xml_config = null;  private static $arr_config = array();  /**   * Default instance level constructor   * Just decorative, should not be called due to having only static methods   */  public function __construct() {    //  }    /**   * Load configurations from config.xml   */  public static function initialise() {    self::$xml_config = file_get_contents("config.xml");    self::$arr_config = xml::parse_text(self::$xml_config);  }    /**   * Get config value from a certain path in config.xml   * @param string $xml_path The path in config.xml   * @return object The value of that xml location (object or primitive)   */  public static function get_config_value($xml_path) {     $xml_path = str_replace(chr(32),"",$xml_path);    $tokens = explode("/",$xml_path);         //find value    $value = self::$arr_config;    foreach ($tokens as $token)       if (isset($value[$token]))        $value = $value[$token];       else        return null;        //return    return $value;  }  /**   * Get website name defined in config.xml   * @return string The name of website    */  public static function get_website_name() {    return self::get_config_value("website");  }    /**   * Get default module defined in config.xml   * @return string The name of default module    */  public static function get_default_module() {     return self::get_config_value("module/default");  }    /**   * Get default language defined in config.xml   * @return string The name of default language    */  public static function get_default_lang() {    return self::get_config_value("language/default");  }   /**   * Get default skin defined in config.xml   * @return string The name of default skin   */  public static function get_default_skin() {    return self::get_config_value("skin/default");  }      /**   * Get default layout defined in config.xml   * @return string The name of default layout   */  public static function get_default_layout() {    return self::get_config_value("layout/default");  }      /**   * Get supported languages defined in config.xml   * @return array The associated array of abbreviations to language names   */  public static function get_supported_langs() {    $abbreviation_list = self::get_config_value("languages/abbreviations");    $name_list = self::get_config_value("languages/names");    $abbreviations = explode(",",$abbreviation_list);    $names = explode(",",$name_list);        //create array    $langs = array();    for ($index=0; $index<count($abbreviations); $index++)      $langs[$abbreviations[$index]] = $names[$index];          return $langs;  }        /**   * Get layout name for displaying error   * @return string The name of layout for error   */  public static function get_error_layout() {    return self::get_config_value("error/layout");  }}</pre>
<div class="header">
<h1>Cornice</h1>
<ul>
<li><a href="../overview-summary.html">Overview</a></li>
<li>Package</li><li>Class</li><li>Tree</li><li><a href="../overview-files.html">Files</a></li>
<li><a href="../deprecated-list.html">Deprecated</a></li>
<li><a href="../todo-list.html">Todo</a></li>
<li><a href="../index-all.html">Index</a></li>
</ul>
</div>

<div class="small_links">
<a href="../index.html" target="_top">Frames</a>
<a href="../source\config.php.html" target="_top">No frames</a>
</div>
<hr>

<p id="footer">This document was generated by <a href="http://peej.github.com/phpdoctor/">PHPDoctor: The PHP Documentation Creator</a></p>

</body>

</html>